package com.wangzefeng.shop.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: wangzefeng
 * @Date: 2021/3/19 14:49
 * @Description:
 */
@Data
@NoArgsConstructor
public class CommonResult {

    private int status;
    private String msg;
    private Object data;

    public static CommonResult getSuccessResult(){
        CommonResult result = new CommonResult();
        result.setStatus(200);
        return result;
    }
    public static CommonResult getSuccessResult(Object data){
        CommonResult result = new CommonResult();
        result.setStatus(200);
        result.setData(data);
        return result;
    }
    public static CommonResult getErrorResult(int status,String msg){
        CommonResult result = new CommonResult();
        result.setStatus(status);
        result.setMsg(msg);
        return result;
    }
}
